#pragma once
#include <vector>
#include "vec3.h"
#include "Light.h"
#include "sampler.h"
#include "BaseAcc.h"
#include "Tracer.h"
#include "Parser.h"

namespace mray{

struct Camera;
struct BaseObject;
struct Ray;
struct Result;
struct BaseMaterial;
struct EmissiveMaterial;
struct BaseTexture;
struct BaseAcc;

struct World : public Parser{

	World();
	~World();

	void Initialize(const std::string& scenePath);
	uchar* Render(uint camId);
	void RenderArea(uint camId, const int startX, const int startY, const int areaX, const int areaY);

	virtual bool Hit(Ray& ray, Result* pResult = nullptr)const;
	virtual vec3 Illuminate(const Result& result)const;
	virtual vec3 GetBgColor(const vec3& direction)const;

private:

	void PostProcess();

	BaseMaterial*				m_pDefMtl;
	BaseMaterial*				m_pDefLigMtl;
	//render tmp
	vec3*						m_data;
	unsigned char*				m_rgb888;
};

}

